home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b2.d64
/
memoranda.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
163 lines
10 DIMYF(99),TF$(99),MF(99),DF(99),T$(99),M(11),M$(11),DM(11):PRINTCHR$(142)
20 FORI=0TO11:READM$(I),M(I):NEXT:DATAJAN,0,FEB,31,MAR,59,APR,90,MAY,120
25 FORI=0TO11:READDM(I):NEXT
30 DATAJUN,151,JUL,181,AUG,212,SEP,243,OCT,273,NOV,304,DEC,334
35 DATA31,28,31,30,31,30,31,31,30,31,30,31
40 POKE53280,1:POKE53281,1
50 PRINT"[147][170][205] [206][180][207][183][183][170][205] [206][180][206][183][205] [207][183][205] [206][183][205][170][205] [180][207][183][205] [206][183][205]"
60 PRINT"[170] [205][206] [180][180] [170] [205][206] [180][180] [170] [180] [170] [180] [170][170] [205] [180][180] [170] [180] [170]"
70 PRINT"[170] [180][207][183] [170] [180][180] [170] [204][175][206] [204][175][186][170] [205][180][180] [170] [204][175][186]"
80 PRINT"[170] [180][204][175][175][170] [180][205][175][206] [180] [205] [180] [170][170] [180][204][175][206] [180] [170]"
90 PRINTTAB(11);"ENTER TODAY'S DATE":INPUT" YYYY,MM,DD ";Y0,M0,D0
100 IFY0<1983ORM0<1ORM0>12ORY0<>INT(Y0)ORM0<>INT(M0)ORD0<>INT(D0)ORD0<1THEN50
110 LY=0:IFY0/4=INT(Y0/4)ANDY0/100<>INT(Y0/100)THENLY=1
120 IFY0/400=INT(Y0/400)THENLY=1
130 IFD0>DM(M0-1)ANDM0<>2THEN50
140 IFD0>DM(M0-1)+LYTHEN50
150 DY=M(M0-1)+D0:IFM0>2THENDY=DY+LY
151 CY=0:L0=DY:L1=L0:H0=DY+14:H1=H0:IFH0<=365+LYTHEN155
152 H0=365+LY:L1=0:H1=DY+14-365-LY:CY=1
155 GOTO880
160 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]":FORI9=1TO21:PRINT"[145][221]";SPC(38);"[221]"
170 NEXT:PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
180 PRINT"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]":RETURN
190 GOSUB160
200 PRINTTAB(13);"[145][144]COMMAND MENU"
210 PRINTTAB(3);"1 - LIST UPCOMING BIRTHDAYS"
220 PRINTTAB(3);"2 - LIST UPCOMING ANNIVERSARIES"
230 PRINTTAB(3);"3 - LIST UPCOMING APPOINTMENTS"
240 PRINTTAB(3);"4 - UPDATE BIRTHDAY FILE"
250 PRINTTAB(3);"5 - UPDATE ANNIVERSARY FILE"
260 PRINTTAB(3);"6 - UPDATE APPOINTMENT FILE"
270 PRINTTAB(3);"_ - EXIT PROGRAM"
280 PRINTTAB(3);"ENTER YOUR COMMAND"
290 GETA$:IFA$=""THEN290
300 IFA$="_"THEN970:REM SAVE FILE AND END
310 IFA$="1"THEN1000:REM LIST BIRTHDAYS
320 IFA$="2"THEN2000:REM LIST ANNIVERSARIES
330 IFA$="3"THEN3000:REM LIST APPOINTMENTS
340 IFA$="4"THEN4000:REM UPDATE BIRTHDAYS
350 IFA$="5"THEN5000:REM UPDATE ANNIVERSARIES
360 IFA$="6"THEN6000:REM UPDATE APPOINTMENTS
370 GOTO290
380 INPUT#15,E0,E$,E1,E2:EF=0:IFE0>19THENEF=1
390 RETURN
400 PRINT" PRESS SPACE[146] TO CONTINUE"
410 GETA$:IFA$<>" "THEN410
420 RETURN
430 PRINTTAB(10);"[144][145]UPCOMING BIRTHDAYS":RETURN
440 PRINTTAB(8);"[144][145]UPCOMING ANNIVERSARIES":RETURN
450 PRINTTAB(8);"[144][145]UPCOMING APPOINTMENTS":RETURN
460 PRINT"[147]";E0;" ";E$;E1;E2:CLOSE2:CLOSE15:END
470 PRINT" PRESS SPACE[146] FOR MENU"
480 GOSUB410:GOTO190
510 P$=M$(M-1)+STR$(D):IFDN=>L1ANDDN<=H1THENY=Y-CY
520 IFLEN(P$)<7THENP$=P$+" ":GOTO520
530 P$=P$+"-"+STR$(Y0-Y):DN=VAL(RIGHT$(P$,1)):DY=Y0-Y
540 IFDN=1AND(DY<10ORDY>20)THENP$=P$+"ST":GOTO580
550 IFDN=2AND(DY<10ORDY>20)THENP$=P$+"ND":GOTO580
560 IFDN=3AND(DY<10ORDY>20)THENP$=P$+"RD":GOTO580
570 P$=P$+"TH"
580 IFLEN(P$)<15THENP$=P$+" ":GOTO580
590 P$=P$+"- "+N$:IFLEN(P$)>35THENP$=LEFT$(P$,35)
600 RETURN
610 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
620 PRINT"[145][221] R - RETAIN RECORD AS IS [221]"
630 PRINT"[145][221] D - DELETE RECORD [221]"
640 PRINT"[145][221] U - UPDATE RECORD AND SAVE [221]"
650 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
660 RETURN
670 GETA$:IFA$<>"R"ANDA$<>"D"ANDA$<>"U"THEN670
675 RETURN
680 IFA$="R"THEN4120
690 IFA$="D"THEN4090
695 GOTO4125
700 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
710 PRINT"[145][221] [221]"
720 PRINT"[145][221] INPUT UPDATED DATA OR PRESS RETURN[146] [221]"
730 PRINT"[145][221] [221]"
740 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
750 RETURN
760 PRINT"[147]END OF EXISTING RECORDS."
770 PRINT"DO YOU WISH TO ADD NEW RECORDS (Y/N)?"
780 GETA$:IFA$<>"Y"ANDA$<>"N"THEN780
790 IFA$="Y"THEN4200
800 GOTO190
820 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
830 PRINT"[145][221] [221]"
840 PRINT"[145][221] INPUT NEW RECORDS AS PROMPTED [221]"
850 PRINT"[145][221] [221]"
851 PRINT"[145][221] ENTER Y,M & D AS NUMBERS ONLY [221]"
852 PRINT"[145][221] [221]"
860 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
870 RETURN
880 OPEN15,8,15:GOSUB380:IFEF=1THEN460
890 OPEN2,8,2,"0:MEMO FILE,S,R":GOSUB380:IFEF=0THEN940
900 IFE0<>62THEN460
910 CLOSE2:OPEN2,8,2,"MEMO FILE,S,W":GOSUB380:IFEF=1THEN460
920 PRINT#2,1:PRINT#2,"M,"Y0","M0","D0",START MEMO FILE":GOSUB380:IFEF=1THEN460
930 CLOSE2:GOTO890
940 INPUT#2,NR:GOSUB380:IFEF=1THEN460
950 FORI=0TONR-1:INPUT#2,TF$(I),YF(I),MF(I),DF(I),T$(I):GOSUB380:IFEF=1THEN460
960 NEXT:CLOSE2:GOTO190
970 OPEN2,8,2,"@0:MEMO FILE,S,W":GOSUB380:IFEF=1THEN460
971 PRINT#2,NR:GOSUB380:IFEF=1THEN460
972 FORI=0TONR-1:PRINT#2,TF$(I)","YF(I)","MF(I)","DF(I)","T$(I):GOSUB380:IFEF=1THEN460
973 NEXT:CLOSE2:CLOSE15:PRINT"[147]";:END
1000 TY$="B":GOSUB160:GOSUB430
1010 I=0:J=0
1020 IFTF$(I)<>TY$THEN1140
1030 D=DF(I):M=MF(I):Y=YF(I):N$=T$(I)
1040 DN=M(M-1)+D:IFM>2THENDN=DN+LY
1050 IF(DN<L0ORDN>H0)AND(DN<L1ORDN>H1)THEN1140
1052 IFTY$<>"M"THEN1060
1053 IFDN>=L0ANDDN<=H0ANDY=Y0THEN1060
1054 IFDN>=L1ANDDN<=H1ANDY=Y0+CYTHEN1060
1055 GOTO1140
1060 J=J+1:IFTY$<>"M"THENGOSUB510:GOTO1100
1070 P$=M$(M-1)+STR$(D)
1080 IFLEN(P$)<7THENP$=P$+" ":GOTO1080
1090 GOSUB590
1100 PRINTTAB(3);P$:IFJ<8THEN1140
1110 GOSUB400:GOSUB160:J=0:IFTY$="B"THENGOSUB430:GOTO1140
1120 IFTY$="A"THENGOSUB440:GOTO1140
1130 GOSUB450
1140 I=I+1:IFI<NRTHEN1020
1150 PRINTTAB(3);"END OF DATA[144]":GOTO470
2000 TY$="A":GOSUB160:GOSUB440:GOTO1010
3000 TY$="M":GOSUB160:GOSUB450:GOTO1010
4000 TY$="B":PRINT"[147]UPDATE BIRTHDAY FILE":PRINT"********************"
4010 PRINT"EDIT EXISTING RECORDS (Y/N)?"
4020 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4020
4030 IFA$="N"THENPRINT"[147]";:GOTO770
4040 I=0
4050 IFTF$(I)<>TY$THEN4120
4060 GOSUB610:GOSUB4070:GOSUB670:GOTO680
4070 PRINT"[144]DATE : ";YF(I);"-";MF(I);"-"DF(I):PRINT"EVENT: ";T$(I);""
4080 RETURN
4090 IFNR=1THEN4120
4095 IFI=NR-1THENNR=I:GOTO4120
4100 FORJ=I+1TONR-1:YF(J-1)=YF(J):TF$(J-1)=TF$(J):MF(J-1)=MF(J)
4110 DF(J-1)=DF(J):T$(J-1)=T$(J):NEXT:NR=NR-1
4120 I=I+1:IFI<NRTHEN4050
4122 GOTO760
4125 GOSUB4130:GOTO4060
4130 GOSUB700:GOSUB4070:PRINTTAB(5);YF(I):INPUT"[145]YEAR";Y
4140 IFY<>INT(Y)ORY<1583OR(TY$<>"M"ANDY>Y0)THEN4130
4150 YF(I)=Y:GOSUB700:GOSUB4070:PRINTTAB(6);MF(I):INPUT"[145]MONTH";M
4160 IFM<>INT(M)ORM<1ORM>12THEN4150
4170 MF(I)=M:GOSUB700:GOSUB4070:PRINTTAB(4);DF(I):INPUT"[145]DAY";D
4180 IFD<>INT(D)ORD<1ORD>(DM(M-1)+1)OR(M<>2ANDD>DM(M-1))THEN4170
4190 DF(I)=D:GOSUB700:GOSUB4070:PRINTTAB(6);T$(I):INPUT"[145]ITEM";T$(I):GOSUB700:GOTO4070
4200 IFNR>=100THENPRINT"RECORD ARRAY FULL!":GOTO470
4210 I=NR:YF(I)=0:TF$(I)=TY$:MF(I)=0:DF(I)=0:T$(I)="-"
4220 GOSUB820:GOSUB400:GOSUB4130:PRINT"ADD THIS RECORD ?";
4230 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4230
4240 PRINTA$:PRINT:IFA$="Y"THENNR=NR+1
4250 PRINT"ANOTHER NEW RECORD ?"
4260 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4260
4270 IFA$="Y"THEN4200
4280 GOTO190
5000 TY$="A":PRINT"[147]UPDATE ANNIVERSARY FILE":PRINT"***********************":GOTO4010
6000 TY$="M":PRINT"[147]UPDATE APPOINTMENT FILE":PRINT"***********************":GOTO4010